package myapp.com.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.xm.httpapi.BaseView.BaseActivity;


//@ViewL(R.layout.test)
public class TestActivity extends BaseActivity {


//    @Override
//    protected void onCreate(@Nullable Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.test);
//        recyclerView = findViewById(R.id.rv);
//        LinearLayoutManager ms = new LinearLayoutManager(this);
//        ms.setOrientation(LinearLayoutManager.VERTICAL);
//        recyclerView.setLayoutManager(ms);
//        myAdapter = new MyAdapter(this, R.layout.item);
//        recyclerView.setAdapter(myAdapter);
//    }

    private RecyclerView recyclerView;
    private MyAdapter myAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.test;
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        recyclerView = findViewById(R.id.rv);
        LinearLayoutManager ms = new LinearLayoutManager(this);
        ms.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(ms);
        myAdapter = new MyAdapter(this, R.layout.item);
        recyclerView.setAdapter(myAdapter);
    }

    @Override
    protected String showTitle() {
        return null;
    }
}
